﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.CQ.NTZYY
{
    /// <summary>
    /// ShuHouFangShiCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class MaZuiTongYiCtrl : CustomCommonTableCtrl
    {
        public MaZuiTongYiCtrl()
        {
            InitializeComponent();
            IniteRadioBation();
            this.Loaded += MaZuiTongYiCtrl_Loaded;
        }

        private void MaZuiTongYiCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.IsNotNeedSaveData = false;
        }


        private void Date1_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                rqn.Value = cusDatePicker.SelectedDateTime.Year;
                rqy.Value= cusDatePicker.SelectedDateTime.Month;
                rqr.Value = cusDatePicker.SelectedDateTime.Day;
                rqs.Value = cusDatePicker.SelectedDateTime.TimeOfDay.Hours;
                rqf.Value = cusDatePicker.SelectedDateTime.TimeOfDay.Minutes;

                // rq1.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);//2005年11月5日
            }
        }
        private void Date2_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;
            cusDatePicker.ShowDialog();
            if (cusDatePicker.Result)
            {
                rqn2.Value = cusDatePicker.SelectedDateTime.Year;
                rqy2.Value = cusDatePicker.SelectedDateTime.Month;
                rqr2.Value = cusDatePicker.SelectedDateTime.Day;
                rqs2.Value = cusDatePicker.SelectedDateTime.TimeOfDay.Hours;
                rqf2.Value = cusDatePicker.SelectedDateTime.TimeOfDay.Minutes;
                //rq2.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);//xxxx年xx月xx日
            }
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(jc_n, jc_y);
            new RadioButtonHelper().ChangeRadioSatus(zt_n, zt_y);
            new RadioButtonHelper().ChangeRadioSatus(hz_n, hz_y);
        }
    }
}
